<template>
	<view>
		<button @click="out">退出登陆</button>
	</view>
</template>

<script setup>
  import { Logout } from '@/utils/ajax.js'

  function out() {
    Logout().then(res => {
      // 移除本地存储的token
      uni.removeStorageSync('token');
      // 跳转到登录页面
      uni.navigateTo({
        url: '/pages/login/login'
      });
    });
  }

  if (!uni.getStorageSync('token')) {
    uni.navigateTo({
      url: '/pages/login/login'
    });
  }
</script>


<style scoped>
	
</style>
